#include <stack>
#include <iostream>
#include "Queue.h"
using std::stack;
namespace notemp {
	class CQueue {
		CQueue() {
			while (!stack1.empty()) {
				stack1.pop();
			}
			while (!stack2.empty()) {
				stack2.pop();
			}
		};
		void appendTail(int value) {
			stack1.push(value);
		}
		int deleteHead() {
			if (stack2.empty()) {
				while (stack1.empty()) {
					stack2.push(stack1.top());
					stack1.pop();
				}
			}
			if (stack2.empty()) { return -1; }
			else {
				int deleteValue = stack2.top();
				stack2.pop();
				return deleteValue;
			}
		}
		~CQueue() {};
	private:
		stack<int> stack1;
		stack<int> stack2;
	};
}
void test(char actual,char expected) {
	if (actual == expected) {
		std::cout << "test passed!" << std::endl;
	}
	else
	{
		std::cout << "test failed!" << std::endl;
	}
}

 int main(int argc,char* argv[]) {
	CQueue<char> q;
	q.appendTail('h');
	q.appendTail('e');
	q.appendTail('l');
	test(q.deleteHead(), 'h');
	test(q.deleteHead(), 'e');
	test(q.deleteHead(), 'l');
	//q.deleteHead();
	return 0;
}